package com.zxjbyte.yiyi.module.upms.domain.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zxjbyte.yiyi.framework.common.annotation.AllowedValues;
import com.zxjbyte.yiyi.framework.common.annotation.InEnumValue;
import com.zxjbyte.yiyi.framework.common.constant.Constant;
import com.zxjbyte.yiyi.framework.common.constant.StatusConstant;
import com.zxjbyte.yiyi.framework.common.enums.GenderEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
 * @Author zhangxingjia
 * @Date 2024/9/14 17:27
 * @Version: 1.0
 */
@Data
@Schema(description = "新增用户信息请求结构体")
public class UserAddParam {

    @Schema(description = "账号")
    @NotBlank(message = "请填写用户账号")
    private String account;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "昵称")
    private String nickName;

    @Schema(description = "真实姓名")
    @NotBlank(message = "请填写用户真实姓名")
    private String realName;

    @Schema(description = "性别：0-未知，1-男，2-女")
    @InEnumValue(enumClass = GenderEnum.class)
    private Integer gender;

    @Schema(description = "出生日期")
    @JsonFormat(pattern = Constant.PATTERN_DATE, timezone = "GMT+8")
    private Date birthday;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "邮箱")
    @Email(message = "请输入正确的邮箱")
    private String email;

    @Schema(description = "电话")
    @NotBlank(message = "请填写用户电话")
    private String phone;

    @Schema(description = "证件类型")
    private Integer idType;

    @Schema(description = "证件号码")
    private String idNo;

    @Schema(description = "状态：0-启用，1-禁用")
    @AllowedValues(intValues = {StatusConstant.ENABLE, StatusConstant.DISABLE})
    private Integer status = StatusConstant.ENABLE;

    @Schema(description = "备注")
    private String remark;
}
